﻿#ifndef DATASTRUCT_H
#define DATASTRUCT_H

#include <QList>
#include <QColor>

// 数据类型的别名
typedef unsigned char          uc;
typedef signed char            sc;
typedef unsigned short         us;
typedef signed short           ss;
typedef unsigned int           ui;
typedef signed int             si;
typedef unsigned long long     ul;
typedef signed long long       sl;
typedef float                  f32, f;
typedef double                 f64, dbl;

// 通道描述表
typedef struct tagChannelDescription {
    QString id;
    QString name;
    QString dataType;
    QString simuType;
    double coefficient;
    int initValue;
    int increaseStep;
    double minValue;
    double maxValue;
    bool hex;
    bool freezed;
} ChannelDescription;

// 通道数据表
typedef struct tagChannelValue {
    long long timeStamp;
    QList<double> valueList;
} ChannelValue;

// 报表行描述表
typedef struct tagReportLine {
    int id;
    QString name;
    double minValue1;
    double maxValue1;
    double minValue2;
    double maxValue2;
} ReportLine;

// 电机指令表
typedef struct tagCmd {
    int id;
    QString name;
    QString cmd;
    QString description;
    QString remark;
} Cmd;

// 训练步骤表
typedef struct tagTrainStep {
    int id;
    QString stepCode;
    QString stepName;
    int level;
    int number;
    QString categoryCode;  // 和训管系统对应的子流程编码
    QString categoryName;  // 和训管系统对应的子流程名称
    QString faultCode;
    QString faultName;
    QString remark;
} TrainStep;

// 流程级别
typedef struct tagFlow {
    int level;
    QString name;
} Flow;

// 子流程
typedef struct tagSubflow {
    int id;
    QString name;
    int operation;
} Subflow;

// 子流程操作步骤
typedef struct tagStep {
    int id;
    int timeline;
    QString name;
    QString code;
    bool send;
    bool wait;
    QString video;
} Step;

// 固定通道
typedef struct tagFixedChannel {
    QString id;
    QString name;
} FixedChannel;

// 曲线属性
typedef struct tagGraphProperty {
    QString id;
    QString name;
    QColor color;
} GraphProperty;

// 数据报表
typedef struct tagVideoPlayback{
    int startTime;
    int duration;
} VideoPlayback;

#endif // DATASTRUCT_H
